import 'package:flutter/material.dart';

void main() {
  // 1. 运行应用程序。
  runApp(MaterialApp(
      home: Scaffold(
    appBar: AppBar(
      title: const Text('你好'),
      backgroundColor: Colors.purple,
    ),
    body: const MyApp(),
  )));
}

class MyApp extends StatelessWidget {
  const MyApp({super.key, this.age = 17});
  // 必须用 final 修饰
  final int age;

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Text('我今年岁了$age'),
    );
  }
}
